
 Bringing up CP/M-8000 on an Olivetti M20
   By Dwight Elvey
    9-29-02

 First requirement is to get at least 256K of RAM. Most
systems ship with only 224K. You'll need a memory board
with at least 128K of RAM installed for a black and white.
The 128K boards can not be mixed with 32K boards.
They must all be of the same size. This will only work
with version 2 of the motherboard. There is an earlier
version that would require extensive modifications that
are beyond what is stated here. The newer boards can be
identified because they have 4ea 74S153 chips mounted
in sockets towards the center of the motherboard ( under
the disk drives). I will describe the modifications to
a RAM card and the changes to the Motherboard here.
 For those that don't have a 128K board handy, one can
modify a 32K board to be 128K. Both the color memory
cards and the normal memory cards can be upgraded in
a similar fashion.
 There are two basic ways to upgrade. One is to use
4164 parts and the other is to use 41256 parts. If
one uses the 256K chips, one still only uses 64K of
each chip. Which you use, depends on how much work you
want to do and the availability parts.
 It takes 16 RAM chips to populate the board( 128K bytes )
The first task is to remove the old RAM chip ( 16 of them
and not the glue logic chips ). If one considers them
selves to be expert level at desoldering, one can
remove the chips and save them for other projects.
If you are not expert, I recommend clipping the IC
leads of the RAMs at the edge of the chips and removing
the pins with a pair of tweezers and soldering iron.
This is a lot safer for the board than removing the
chips intact. The choise is yours.
 After removing the chips and leads, make sure that all
of the holes have been cleared with either a solder
sucker or solder wick. At this point, one has two paths
that are different. 64K chips or 256K chips.

64K Chips:
 Put a small amount of kevlar tape or small drop of epoxy
on the pin 9 hole in the board, such that when you mount
a socket with pin 9 bent out to the side it will not short
to the pin 9 hole on the board ( if using epoxy, check the
position of the hole twice. Epoxy is forever ). Install
sockets with pin 9 bent out to the side or in the case
you use machine pin sockets, a small piece of wire wrap
wire soldered to pin 9 with the tip broken off the machine
pin( wire should be about 1 inch ).
 Run a common wire between all of the pin 9 wires. This
will be connected to the additional address line. Both
of the board types I have are slightly different here. The
color memory board that I have, has the address line available
at RP2-6. The normal memory card it is at J4-A. If this doesn't
look right for your board, trace the edge pin P1-56 to a
pin of a 74S04. Follow the corresponding output pin to one
of the R-packs. One of the 2 adjacent pins will be unused
or go to a jumper location. This is the one you need.
The common pin 9 wire should go to this R-pack pin.
 The power connections are different on the 64K chips than
the original 64K chips. There is a +12V line running to
pin 8 of the RAMs. This needs to be changed to +5V.
The easiest way is to cut the +12V line right near the
edge of the board and jumper to +5V. P1-1 thru P1-4
are +12V. P1-5 thru P1-8 are +5V. When looking at the card
from the trace side, one can see two holes next to the
P1 on the +12V line. There are two more hole, farther
in on the board. Cut the trace between these two sets.
Check that it it really cut with an ohm meter. A lot
of damage can be done if not isolated. On the trace towards
the board, make a wire jumper between what was the +12V
line and the adjacent trace ( +5V ).
 This completes the modification to the board. Check
and double check that you haven't shorted +5v to +12V
or any of the other power leads. Check it one more time!
Mount the new memory chips. Remember, these are not
like ttl chips. Pin 8 is +5V, not ground.

256K Chips:
 This modification is a little easier, since one doesn't
need to issolate pin 9. We can use the line going to pin
1 instead as the additional address line and leave the
address line on pin 9 pulled to +5V. Follow the steps
for the 64K chips but ignore the pin 9 information. Make
sure to make the modification for the +12V that needs to
be changed to +5V for pin 8.
 There is a common line connected to pin 1 that goes to
-12V. This needs to be cut from the -12V line. On the color
board I have, it needs a cut, similar to that use for the
+12V line. On my B/W board, one only needs to remove the
jumper at the right end ( J1 ). There are also
a number of bypass capacitors that nee to be removed.
There is an electrolytic and several ceramics that need
to be removed. Look at all of the pin 1 connections and
follow the traces. I count 12 on my B/W board. These all
need to be removed. Don't remove the other bypass caps
used for the other lines. Check with an Ohm meter to varify
that the cap is infact connected to pin 1. Find a
convenient place to connect the common line to pin 1 to
the R-pack address line as stated in the 64K mod.
Check that neither the +12V or -12V lines are still connected
to any of the chip locations or shorted to the +5V lines.
Almost anything else done wrong can be fixed but if you
plug a card in without making sure this is done, it may
do a lot of damage to the powersupply, motherboard and
this card, so check carefully.


Motherboard Modifications:

 One will need about 10 of the jumper shorts like those already
on the motherboard. CPM doesn't support color modes so I will
only describe the 2 color or Black/White ( B/W ) changes. This
is the only configuration that I have checked out. The CPM may
work with one of the color configurations but I have not tried
them.
 Disassemble the main unit to the point that the motherboard
is exposed( remove the keyboard and the disk drives ). Remove the
four socketed 74S153's.  Save these for spares, as they are not
needed for the large memory size and would interfer with proper
address generation if left in the sockets. With the keyboard end to
the left, there should be a jumper block just to the left of the
MEM EXP 1 connector. This location is labeled 128K-32K. Move
the jumper to the center and 32K position. Locate the strip of
8 jumper loactions just to the right and down from the right
hand socket U65 that you removed the ICs from. You should see
jumpers soldered on the board. You need to add 8 jumper bocks to
the locations 0 thru 7, right next to the soldered jumpers on the
board. One can use wirewraps if one doesn't have jumper blocks.
One row of IC's up and a little to the right is a jumper location
labeled (C). Move the jumper block to connect the center and PU.
About 3 inches to the left is a jumper location labled (A). Move
the jumper block to connect the center and TSN1. About 2 inches
above and a little to the left is a jumper location (B). Move this
jumper block to connect the center and TSN2. Above and to the right,
it the address decoder mask ROM ( U35 ). Just above this is a jumper
location labeled (512K)-(128K/244K). Set this jumper to the (512K)
and center. To the right of this are 4 jumper locations. Install
only one jumper block at the top location ( VIODA ). If you are working
on a color system, you'll need to configure for the 2 color.
You can experiment with the color jumpers later with more RAM but
for now, these 4 locations should have only the one jumper.
 This completes the changes to the motherboard. Install your modified
memory card in MEM EXP 1 ( a total of 3 of these 128K cards may
be installed for a total of 512K ). Reassemble the system and
boot a PCOS system disk. Use 'vf 1:" to format a disk. Use a
disk tool to write the CPM image ( RELA11.IMG ) onto this disk.
If the system you are using can transfer the side 0 track 0
as single density, this can be done. Most transfer programs
will warn that there is a problem with these sectors but can
continue to transfer the rest as double density  (360k type on PC).
Use a similar method to transfer the other files to disk as
well. Place the REL11.IMG into dirve 0: and reboot. CPM boots:

CP/M-8000(tm) Version 1.1 12/19/84
Copyright (c) 1984, Digital Research Inc.
1%A>

 Note: errors on user number. One needs to reset it
with the USER command. This is a bug in this version??
I leave this bug for who ever wants to find it.


About Release 1.1:

 The disk image set REL11A.IMG, REL11B.IMG, REL11C.IMG, TEXT11.IMG
AND MISC11.IMG are 5.25 inch disk images for the CP/M-8000
release 1.1. I believe that this was the official release and
that the revision numbers were reset for the release. The other
revisions were most likely development resisions. Only REL11A.IMG
is a bootable disk, as it has the boot tracks and CPM.SYS. One
can use FORMAT and COPY to create more bootable disk. One
can then use PIP to setup other work disks. I've found that
if one copies from drive A to drive B, one can start PIP from
one disk in drive A and replace it with another disk to copy
from. Other combinations cause a failure because the directories
don't match logged disk. This makes moving files a little easier
since you don't need to have a copy of PIP in the drive during
the file copy.
 Many of the utilities use the default drive for temporary files
so keep some space open. I've found that programs like ZCC that
have various overlays, the overlays need to be on the current
default drive.
 In working with these images, I found that BIOS.REL was missing
the data. I have been worked out how to recreate this file.
There was a file wasn't correct called BIOS.SUB. It incorrectly
used the -w option while creating BIOS.REL. The -w option should only
used at the last link when creating the actual execution file.
I've corrected this file but it may still not be useful in a
dual floppy system. See my notes about PAUSE below and linker
error. It has taken me several days to track this -w problem down.
 Also, another bug was found in the linker LD8K.Z8K. When using
the -r option ( needed to create relative files ) it would not
find the object files to load. I recreated the linker from source
code found in 8K055583.ZIP. I've named this LD8K2.Z8K and placed
it in the disk set. It is an older version and may have errors
but seems to create relative files correctly. Using this, I was
able to create a BIOS.REL and eventually a CPM.SYS that was a
match for the CPM.SYS that was on the release image.
 The submit files were created for a system that had larger drives
than I have. I would suspect it was used on a Olivetti that had
a hard drive. The number of files needed to complete and entire
sequence of assemble, compile and link will take more disk space
than can be easily placed on two floppy disk at one time. I've split
my disk such that the ZCC is on one disk and the other pieces
for AS8K and LD8K on an other disk. If this is placed in a submit,
one will need a PAUSE command to allow disk changes to access
all the needed resources. I have written ( poorly ) a simple
PAUSE.Z8K. It has a fixed prompt so one should make a comment
line before it to prompt the next action. I've included my
PAUSE.Z8K but I suspect that when one sees the execution size,
one might want to rewrite this in the assembler. I used the
ZCC and it isn't well optimized. It was just a quick and dirty
pass. Anyway, the PAUSE makes the use of submit files practical
in the standard 2 floppy Olivetti.

About the Image Files:

 These are almost direct disk images. The Olivetti uses 16 sectors
per track. All but the first side of track 0 are MFM and the
sectors are 256 bytes each. Track 0 side 0 is FM of 128 byte
sectors. On the boot track0 side 0, only the first sector is
used by the Olivetti boot PROM. This information works in conjunction
with the boot loader for CP/M on Track 0 side 1 through Track 2.
Track 3 contains the CP/M directory and the rest of the CP/M image
folows. Non-boot disk only need the information from Track 3
and on.
 Creating the boot image is a problem without a working CP/M-8000.
If one can create the first track information in FM, one can use
these image files directly. If not, and one has a working PCOS,
one can use PCOS to create the first track information ( slightly
different than CP/M creates but not an issue ). One can then overlay
the MFM tracks on the disk to complete the rest of the image.
 I have included a program that I wrote to build images ( less the
first track ). It isn't perfect and seems to have issues with
different platforms. On my system, it works under the following
conditions:
  AT 486 system, Source files on hard drive, 360K disk drive in drive A:
I have PC DOS Version 7.0 as well. This should be run from a pure
DOS level and most likely won't work from a windowed dos.

 I do know that it doesn't work if the source image is also on
a floppy. Your mileage may vary. This program is known to not
work of some other machines than mine. You must use a 360K drive,
not a 1.2M.
 The image files are raw images. The information on Track 0, Side 0
is written in the first 2048 bytes. It is then padded with another
2048 bytes to have the same spacing and the MFM tracks. This gives
a file size of 286720 for an entire 35 track disk ( standard Olivetti ).
 This transfer program is called WRM20.COM. It is used:
    WRM20 A: File.IMG
 Note that the A: is spaced from the file name and refers to the
360K drive.
 If requires that the disk be preformated as 16 sector/track, 256 byte
per sector and 35 double sided tracks. If the disk is to be used
as the boot disk ( REL11A.IMG ) one must have the correct data and
FM format on Track 0 Side 0 as well. If you have the ability to do
FM, the first 2048 bytes of any image file may be used.

Other things:
 The memory system in the Olivetti is not linear. CP/M expects the
system to be setup as a B/W with a minimum of 256K total. There
are several segements ( 64K spaces ) that are used by CP/M.
The address space <<8>>0000 thru <<8>>FFFF is divided to separate
physical memory for data and instructions spaces. This allows large
programs to use two 64K spaces while staying in the non-segemented
mode( as is typical for this CP/M ). The data space for <<8>>0000
is dual mapped to <<9>>0000 and the instruction space is dual mapped
to <<A>>0000. Some of the CP/M utilities take advantage of this
by using this split memory. Using the -i option with LD8K will
create such files. Other normally generated file use the <<A>>0000
segement space with both instruction and data mapped to the same
physical memory.
 CP/M-8000's built in and the Floating point emulation reside in
the <<B>>0000 segment. This normally is always resident and doesn't
require reloading after other programs run( unless this space it
reused ). In the normal Olivetti with only a single 128K memory
card added, <<B>>0000 is only 48K. This restricts the size of the
CPM.SYS that may be in this sagment.
 Went creating an executable for CP/M, the last link should include
STARTUP.O amd -LCPM. STARTUP.O provides the system dependent interface
between the OS and your MAIN as well at the BIOS links. All ZCC
created files will require STARTUP.O or a similar code written by
thru the assembler. The typical creation of a program might look
like:

zcc -c -m1 MyFile.C
ld8k -w -o MyFile.Z8K STARTUP.O MyFile.O -lcpm

ZCC bug:

There is a minor bug in zcc. It doesn't like one to redefine
key words. As an example, this doesn't work: #define uns unsigned
One of the source files needs to be edited ( I believe BIOS.C )
to change uns and reg to unsigned and register.

Documentation Errors:
 These are the things I've found:

CP/M-8000 Programmer's Guide
 3.2   The segement array element doesn't exist ( 4th bullet ).
 6.3   No mention of the following options:
         -w used to preassign the 4 segements; code, constants, data
              and bss
         -x Don't save local symbols ( reduce the size of .RELs ?? )
         -h Debug printouts
         -m Prints the segement sizes and symbols information

       Output file extention determines the file type, in combination

        with the -i option.

My current eMail is dkelvey@hotmail.com. If you have questions
that I might be able to answer, contact me. Use a relevent subject,
as this mailbox receives a lot of spam and I delete such mail as
"HI", "Important" or "Must read". I'll most likely read one like
"CP/M-8000 Questions".

